/**
 * 
 */
package org.dbwebx.gwt.mvp.presenter;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.mvp4g.client.presenter.Presenter;

/**
 * @author Izzet_Mustafayev
 * 
 */
public class BasePresenter<V> extends Presenter<V> {

	protected <T> T changeServiceEntryPoint(T serviceTarget) {
		String path = ((ServiceDefTarget) serviceTarget).getServiceEntryPoint();
		path = path.replace(GWT.getModuleBaseURL(), "");
		String serviceUrl = GWT.getHostPageBaseURL() + "gwt/" + path;
		((ServiceDefTarget) serviceTarget).setServiceEntryPoint(serviceUrl);
		return serviceTarget;
	}
}
